package com.example.bbs.util;


import com.example.bbs.domain.entity.User;
import org.springframework.stereotype.Component;

@Component
public class HostHold {
    private static ThreadLocal<User> threadLocal = new ThreadLocal<>();

    public static void set(User user) {
        threadLocal.set(user);
    }

    public static User get() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }
}
